package cn.com.connext.scrm.repository.master;

import cn.com.connext.scrm.domain.master.Student;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface StudentRepository extends JpaRepository<Student, String> {

    @Query(value = "select s.mobile from Student s group by s.mobile")
    List<String> findAllMobile();

    List<Student> findAllByMobile(String mobile);

    List<Student> findAllByMobileOrderByLessonDesc(String mobile);
}
